﻿package com.ouken.activity;
import android.os.Bundle;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;

public class MySettingsActivity extends Activity {
	private Context context;
	private ImageButton back2;
	private ImageButton back1;
	private ImageButton add_device_cmd;
	private ImageButton delete_device_cmd;
	private ImageButton me_edit_device_cmd;
	private ImageButton help_for_all_cmd;
	private void initView(){
		context = this;
		back1 = (ImageButton)findViewById(R.id.mysettings_back1); 
		back2 = (ImageButton)findViewById(R.id.mysettings_back2); 
		add_device_cmd = (ImageButton)findViewById(R.id.add_device_cmd); 
		delete_device_cmd = (ImageButton)findViewById(R.id.delete_device_cmd); 
		me_edit_device_cmd=(ImageButton)findViewById(R.id.device_edit_button); 
		help_for_all_cmd=(ImageButton)findViewById(R.id.device_help_button); 
	}
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.mysettings);
		initView();
		
		back1.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				MySettingsActivity.this.finish();
			}
		});
		
		back2.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				MySettingsActivity.this.finish();
			}
		});
		
		add_device_cmd.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(context, AddDeviceActivity.class); 
		        startActivity(intent);
			}
		});
		delete_device_cmd.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				Intent intent = new Intent(context, DeleteDevicesListActivity.class); 
		        startActivity(intent);
			}
		});
		me_edit_device_cmd.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				Intent intent = new Intent(context, MySettingsOnlineActivity.class); 
		        startActivity(intent);
			}
		});
		help_for_all_cmd.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				Intent intent = new Intent(context, HelpWebActivity.class); 
		        startActivity(intent);
			}
		});
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		return true;
	}

}
